//
//import org.jeecg.modules.lab.util.TokenServess;
//import org.junit.Test;
//
//import javax.crypto.Mac;
//import javax.crypto.spec.SecretKeySpec;
//import java.io.IOException;
//import java.net.InetAddress;
//import java.security.InvalidKeyException;
//import java.security.NoSuchAlgorithmException;
//public class test2 {
//    private static final String HMAC_SHA1_ALGORITHM = "HmacSHA1";
//    @Test
//    public void test() throws NoSuchAlgorithmException, InvalidKeyException {
//        String appCode = "507275147443437568";
//        //key
//        String key = "TFJUBrMwCyVsQnsJHFZPVjWFvk1HdruQ";
//        //时间戳
//        long timestamp = System.currentTimeMillis();
//        System.out.println("时间戳："+timestamp);
//        //原数据
//        String data = "EWfADbCnR8kxirMB115qIk3T4DHSNtsT"+timestamp;
//        SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), HMAC_SHA1_ALGORITHM);
//        Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM);
//        mac.init(signingKey);
//        byte[] rawHmac = mac.doFinal(data.getBytes());
//
//        StringBuilder hmacBuilder = new StringBuilder();
//        for (byte b : rawHmac) {
//            hmacBuilder.append(String.format("%02x", b));
//        }
//        String sss = hmacBuilder.toString();
//        System.out.println("xxxxxxxxxxxxx");
//        System.out.println("Authorization:"+sss);
//        //return hmacBuilder.toString();
//    }
//    //获取员工票据
//    @Test
//    public void test3() throws NoSuchAlgorithmException, InvalidKeyException, IOException {
//        String OYD = "eyJ0eXAiOiJqd3QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1MDcyNzUxNDc0NDM0Mzc1NjgiLCJhdWQiOiJiYXNlIiwiaXNzIjoiemh1bnplIiwiZXhwIjoxNjk5NTIzMDg2LCJpYXQiOjE2OTk1MTUyODZ9.4RCXHlH6Bb8lMUeBxbsJzf0BnzrsondaXjds0WNIU_M";
//        TokenServess tokenServess = new TokenServess();
//        tokenServess.getEmployeeTicket("43",null,OYD);
//        System.out.println("ssssssssss");
//
//    }
//    @Test
//    public void test2() throws NoSuchAlgorithmException, InvalidKeyException, IOException {
//        InetAddress addr = InetAddress.getLocalHost();
//        System.out.println("Local HostAddress:" + addr.getHostAddress());
//        System.out.println("Local host name:" + addr.getHostName());
//        TokenServess tokenServess = new TokenServess();
//        tokenServess.getTokenServe();
//    }
//}
